﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AMS.DD35.DbLoader.Models;
using AMS.DD35.DbLoader.Views;

namespace AMS.DD35.DbLoader.Controllers
{
    class SourceController : EditorControllerBase, ISourceController
    {
        private ISourceModel _model;

        public SourceController()
        {
        }

        #region Initialization Methods
        protected override void InitializeFields()
        {
            // tightly couple here per MVC
            _model = new SourceModel();
            _browser = new BrowserDialog(this);
            _browser.NewButtonText = "New Source";
            _browser.Text = "Source Browser";

            IEnumerable<object> Source = _model.GetSources();
            _browser.Populate(Source);
        }

        protected override void LoadEditor()
        {
            // TODO: prep editor to be Editor
            // Get data
            // Load data into Editor
            SourceEditor editor = new SourceEditor(this);
            // other load methods

            _editor = editor;
        }

        protected override void PrepNewEditor()
        {
            // prep editor to be New
            SourceEditor editor = new SourceEditor(this);

            _editor = editor;
        }
        #endregion
    }
}
